package cn.iocoder.yudao.module.member.service.studentCurriculumVitae;

import cn.hutool.core.bean.BeanUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.SortingField;
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
import cn.iocoder.yudao.module.member.api.studentCurriculumVitae.dto.StudentCurriculumVitaeRespDTO;
import cn.iocoder.yudao.module.member.api.studentEducationalExperience.dto.StudentEducationalExperienceCreateReqDTO;
import cn.iocoder.yudao.module.member.controller.admin.student.vo.StudentExcel;
import cn.iocoder.yudao.module.member.controller.admin.student.vo.StudentFileVO;
import cn.iocoder.yudao.module.member.controller.admin.student.vo.StudentPageReqVO;
import cn.iocoder.yudao.module.member.controller.admin.studentCurriculumVitae.vo.*;
import cn.iocoder.yudao.module.member.convert.studentCurriculumVitae.StudentCurriculumVitaeConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.student.StudentDO;
import cn.iocoder.yudao.module.member.dal.dataobject.studentCurriculumVitae.StudentCurriculumVitaeDO;
import cn.iocoder.yudao.module.member.dal.dataobject.studentCurriculumVitae.StudentFileDO;
import cn.iocoder.yudao.module.member.dal.dataobject.studentEducationalExperience.StudentEducationalExperienceDO;
import cn.iocoder.yudao.module.member.dal.mysql.praxisEntryInfo.PraxisEntryInfoMapper;
import cn.iocoder.yudao.module.member.dal.mysql.student.StudentMapper;
import cn.iocoder.yudao.module.member.dal.mysql.studentCurriculumVitae.StudentCurriculumVitaeMapper;
import cn.iocoder.yudao.module.member.dal.mysql.studentEducationalExperience.StudentEducationalExperienceMapper;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import me.zhyd.oauth.log.Log;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;

import javax.annotation.Resource;
import java.util.*;

import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*;

/**
 * 用户简历 Service 实现类
 *
 * @author 周枫皓
 */
@Service
@Validated
public class StudentCurriculumVitaeServiceImpl implements StudentCurriculumVitaeService {

    @Resource
    private StudentCurriculumVitaeMapper studentCurriculumVitaeMapper;
    @Resource
    private StudentEducationalExperienceMapper studentEducationalExperienceMapper;
    @Resource
    private StudentMapper studentMapper;
    @Resource
    private PraxisEntryInfoMapper praxisEntryInfoMapper;
    @Override
    @Transactional(rollbackFor = Exception.class)
    public Long createStudentCurriculumVitae(StudentCurriculumVitaeCreateReqVO createReqVO) {
        // 插入
        StudentCurriculumVitaeDO studentCurriculumVitae = StudentCurriculumVitaeConvert.INSTANCE.convert(createReqVO);
        studentCurriculumVitaeMapper.insert(studentCurriculumVitae);
        //插入教育经历
        List<StudentEducationalExperienceCreateReqDTO> studentEducationalExperienceCreateReqDTOS=createReqVO.getEducationalExperience();
        StudentEducationalExperienceDO studentEducationalExperienceDO =new StudentEducationalExperienceDO();
        for (StudentEducationalExperienceCreateReqDTO studentEducationalExperienceCreateReqDTO:studentEducationalExperienceCreateReqDTOS) {
            studentEducationalExperienceCreateReqDTO.setStudentId(studentCurriculumVitae.getId());
            BeanUtil.copyProperties(studentEducationalExperienceCreateReqDTO,studentEducationalExperienceDO);
            studentEducationalExperienceMapper.insert(studentEducationalExperienceDO);
        }
        // 返回
        return studentCurriculumVitae.getId();
    }

    @Override
    public void updateStudentCurriculumVitae(StudentCurriculumVitaeUpdateReqVO updateReqVO) {
        // 校验存在
        this.validateStudentCurriculumVitaeExists(updateReqVO.getId());
        // 更新
        StudentCurriculumVitaeDO updateObj = StudentCurriculumVitaeConvert.INSTANCE.convert(updateReqVO);
        studentCurriculumVitaeMapper.updateById(updateObj);
        //插入教育经历
//        studentEducationalExperienceMapper.deleteByStudentId(updateReqVO.getId());
        studentEducationalExperienceMapper.delete(new QueryWrapper<StudentEducationalExperienceDO>().eq("student_id", updateReqVO.getId()));
        List<StudentEducationalExperienceDO> studentEducationalExperienceDOS=updateObj.getEducationalExperience();
        if(CollectionUtils.isNotEmpty(studentEducationalExperienceDOS)){
            studentEducationalExperienceDOS.stream().forEach(m->{
                m.setStudentId(updateReqVO.getId());
                m.setId(null);
            });
            studentEducationalExperienceMapper.insertBatch(studentEducationalExperienceDOS);
        }
    }

    @Override
    public void updateByStudentId(StudentCurriculumVitaeUpdateReqVO updateReqVO) {
        // 校验存在
        if (studentCurriculumVitaeMapper.selectCount("student_id",updateReqVO.getStudentId())>0) {
            StudentCurriculumVitaeDO updateObj = StudentCurriculumVitaeConvert.INSTANCE.convert(updateReqVO);
            studentCurriculumVitaeMapper.update(updateObj,new QueryWrapper<StudentCurriculumVitaeDO>().eq("student_id",updateReqVO.getStudentId()));
        }
    }


    @Override
    public void deleteStudentCurriculumVitae(Long id) {
        // 校验存在
        this.validateStudentCurriculumVitaeExists(id);
        // 删除
        studentCurriculumVitaeMapper.deleteById(id);
    }

    private void validateStudentCurriculumVitaeExists(Long id) {
        if (studentCurriculumVitaeMapper.selectById(id) == null) {
            throw exception(STUDENT_CURRICULUM_VITAE_NOT_EXISTS);
        }
    }

    @Override
    public StudentCurriculumVitaeDO getStudentCurriculumVitae(Long id) {
        StudentCurriculumVitaeDO studentCurriculumVitaeDO= studentCurriculumVitaeMapper.selectById(id);
        //教育经历
        if(studentCurriculumVitaeDO!=null) {
            List<StudentEducationalExperienceDO> studentEducationalExperienceDOS = studentEducationalExperienceMapper.selectListByStudentId(id);
            studentCurriculumVitaeDO.setEducationalExperience(studentEducationalExperienceDOS);
        }
        return studentCurriculumVitaeDO;
    }

    @Override
    public List<StudentCurriculumVitaeDO> getStudentCurriculumVitaeList(Collection<Long> ids) {
        return studentCurriculumVitaeMapper.selectBatchIds(ids);
    }

    @Override
    public PageResult<StudentCurriculumVitaeDO> getStudentCurriculumVitaePage(StudentCurriculumVitaePageReqVO pageReqVO) {
        Integer total = studentCurriculumVitaeMapper.count1(pageReqVO);
        if (total <= 0) {
            return PageResult.empty();
        }
        if(null==pageReqVO.getSortField()){
            SortingField sortField=new SortingField ();
            sortField.setField("o.id");
            sortField.setOrder("desc");
            pageReqVO.setSortField(sortField);
        }
        List<StudentCurriculumVitaeDO> studentCurriculumVitaeDOS=studentCurriculumVitaeMapper.selectPage1(pageReqVO);
        for (StudentCurriculumVitaeDO studentCurriculumVitaeDO:studentCurriculumVitaeDOS) {
            if(studentCurriculumVitaeDO!=null&&studentCurriculumVitaeDO.getId()!=null) {
                List<StudentEducationalExperienceDO> studentEducationalExperienceDOS = studentEducationalExperienceMapper.selectListByStudentId(studentCurriculumVitaeDO.getId());
                studentCurriculumVitaeDO.setEducationalExperience(studentEducationalExperienceDOS);
            }
        }
        return PageResult.build(studentCurriculumVitaeDOS, total);
    }


    @Override
    public List<StudentCurriculumVitaeDO> getStudentCurriculumVitaeList(StudentCurriculumVitaeExportReqVO exportReqVO) {
//        if(null!=exportReqVO.getStudentExcelFlag() && 1==exportReqVO.getStudentExcelFlag()){
//            StudentCurriculumVitaePageReqVO reqVO=new StudentCurriculumVitaePageReqVO();
//            BeanUtils.copyProperties(exportReqVO,reqVO);
//            reqVO.setPageSize(10000);
//                if(null==reqVO.getSortField()){
//                    SortingField sortField=new SortingField ();
//                    sortField.setField("o.id");
//                    sortField.setOrder("desc");
//                    reqVO.setSortField(sortField);
//                }
//                List<StudentCurriculumVitaeDO> studentCurriculumVitaeDOS=studentCurriculumVitaeMapper.selectPage1(reqVO);
////            List<StudentCurriculumVitaeDO> studentCurriculumVitaeDOS = studentCurriculumVitaeMapper.selectList(exportReqVO);
//            if(StringUtils.isNotBlank(exportReqVO.getType()) && "export".equals(exportReqVO.getType())){
//                for (StudentCurriculumVitaeDO studentCurriculumVitaeDO:studentCurriculumVitaeDOS) {
//                    if(studentCurriculumVitaeDO!=null&&studentCurriculumVitaeDO.getId()!=null) {
//                        List<StudentEducationalExperienceDO> studentEducationalExperienceDOS = studentEducationalExperienceMapper.selectListByStudentId(studentCurriculumVitaeDO.getId());
//                        studentCurriculumVitaeDO.setEducationalExperience(studentEducationalExperienceDOS);
//                    }
//                }
//            }
//            return studentCurriculumVitaeDOS;
//        }
        List<StudentCurriculumVitaeDO> studentCurriculumVitaeDOS ;
        if(StringUtils.isNotBlank(exportReqVO.getType()) && "export".equals(exportReqVO.getType())){
            StudentCurriculumVitaePageReqVO pageReqVO=new StudentCurriculumVitaePageReqVO();
            BeanUtils.copyProperties(exportReqVO,pageReqVO);
            if(null==pageReqVO.getSortField()){
                SortingField sortField=new SortingField ();
                sortField.setField("o.id");
                sortField.setOrder("desc");
                pageReqVO.setSortField(sortField);
            }
            studentCurriculumVitaeDOS=studentCurriculumVitaeMapper.selectPage1(pageReqVO);
            for (StudentCurriculumVitaeDO studentCurriculumVitaeDO:studentCurriculumVitaeDOS) {
                if(studentCurriculumVitaeDO!=null&&studentCurriculumVitaeDO.getId()!=null) {
                    List<StudentEducationalExperienceDO> studentEducationalExperienceDOS = studentEducationalExperienceMapper.selectListByStudentId(studentCurriculumVitaeDO.getId());
                    studentCurriculumVitaeDO.setEducationalExperience(studentEducationalExperienceDOS);
                }
            }
        }else{
            studentCurriculumVitaeDOS=studentCurriculumVitaeMapper.selectList(exportReqVO);
        }
        return studentCurriculumVitaeDOS;

    }

    @Override
    public List<StudentCurriculumVitaeExcelVO> exportStudentCurriculumVitaeExcel(StudentCurriculumVitaeExportReqVO exportReqVO) {
        exportReqVO.setType("export");
        List<StudentCurriculumVitaeDO> list = this.getStudentCurriculumVitaeList(exportReqVO);
        // 导出 Excel
        List<StudentCurriculumVitaeExcelVO> datas = StudentCurriculumVitaeConvert.INSTANCE.convertList02(list);
        if(CollectionUtils.isNotEmpty(datas)){
            datas.stream().forEach(m->{
                StringBuffer internshipDesire=new StringBuffer();
                if(StringUtils.isNotBlank(m.getInternshipDesire())){
                    JSONArray array=JSONObject.parseArray(m.getInternshipDesire());
                    if(null!=array && array.size()>0){
                        for (int i = 0; i < array.size(); i++) {
                            JSONObject o =(JSONObject) array.get(i);
                            internshipDesire.append(o.getString("jobName"));
                            internshipDesire.append(",");
                            JSONArray expectedIndustry = o.getJSONArray("expectedIndustry");
                            if(null!=expectedIndustry && expectedIndustry.size()>0){
                                boolean f=false;
                                for (int j = 0; j < expectedIndustry.size(); j++) {
                                    String e = expectedIndustry.getString(j);
                                    if(StringUtils.isNotBlank(e)){
                                        f=true;
                                        internshipDesire.append(e);
                                    }
                                }
                                if (f){
                                    internshipDesire.append(",");
                                }
                            }
                            internshipDesire.append(o.getString("lowestSalary"));
                            internshipDesire.append("-");
                            internshipDesire.append(o.getString("highestSalary"));
                            internshipDesire.append("元/天");
                            internshipDesire.append(",");
                            internshipDesire.append(o.getString("targetCity"));
                            internshipDesire.append(";");
                        }
                    }
                }
                m.setInternshipDesire(internshipDesire.toString());
                //教育经历
                StudentCurriculumVitaeDO s = list.stream().filter(f -> f.getId() == m.getId()).findFirst().orElse(null);
                StringBuffer educationalJson=new StringBuffer();
                String specialty="";
                if(null!=s && CollectionUtils.isNotEmpty(s.getEducationalExperience())){
                    List<StudentEducationalExperienceDO> educationalExperience = s.getEducationalExperience();
                    if(CollectionUtils.isNotEmpty(educationalExperience)){
                        for (int i = 0; i < educationalExperience.size(); i++) {
                            StudentEducationalExperienceDO d=educationalExperience.get(i);
                            educationalJson.append(d.getSchoolName());
                            educationalJson.append(",");
                            educationalJson.append(d.getEducationalBackground());
                            educationalJson.append(",");
                            if(null==d.getDiploma() || d.getDiploma().equals(0)){
                                educationalJson.append("无学位证书");
                            }else{
                                educationalJson.append("有学位证书");
                            }
                            educationalJson.append(",");
                            educationalJson.append(d.getIntakeTime());
                            educationalJson.append("~");
                            educationalJson.append(d.getGraduateTime());
                            educationalJson.append(",");
                            educationalJson.append(d.getIsOverseasStudy()+"海外留学经历");
                            educationalJson.append(";");
                            if(StringUtils.isNotBlank( d.getMajor())){
                                if(StringUtils.isNotBlank(specialty)){
                                    specialty+="；";
                                }
                                specialty+=d.getMajor();
                                if(StringUtils.isNotBlank(d.getEducationalBackground())){
                                    specialty+="("+d.getEducationalBackground()+")";
                                }
                            }
                        }
                    }
                }
                m.setSpecialty(specialty);
                m.setEducationalJson(educationalJson.toString());
                String workExperience = m.getWorkExperience();
                StringBuffer workExperienceJson=new StringBuffer();
                if(StringUtils.isNotBlank(workExperience)){
                    JSONArray array=JSONObject.parseArray(workExperience);
                    if(null!=array && array.size()>0){
                        for (int i = 0; i < array.size(); i++) {
                            JSONObject o =(JSONObject) array.get(i);
                            workExperienceJson.append(o.getString("entryTime"));
                            workExperienceJson.append("~");
                            workExperienceJson.append(o.getString("resignationTime"));
                            workExperienceJson.append(",");
                            workExperienceJson.append(o.getString("companyName"));
                            workExperienceJson.append(",");
                            workExperienceJson.append(o.getString("jobName"));
                            workExperienceJson.append(",");
                            workExperienceJson.append(o.getString("industry"));
                            workExperienceJson.append(",");
                            workExperienceJson.append(o.getString("jobDescription"));
                            workExperienceJson.append(";");
                        }
                    }
                }
                m.setWorkExperience(workExperienceJson.toString());
                String projectExperience = m.getProjectExperience();
                StringBuffer projectExperienceJson=new StringBuffer();
                if(StringUtils.isNotBlank(projectExperience)){
                    JSONArray array=JSONObject.parseArray(projectExperience);
                    if(null!=array && array.size()>0){
                        for (int i = 0; i < array.size(); i++) {
                            JSONObject o =(JSONObject) array.get(i);
                            projectExperienceJson.append(o.getString("beginTime"));
                            projectExperienceJson.append("~");
                            projectExperienceJson.append(o.getString("endTime"));
                            projectExperienceJson.append(",");
                            projectExperienceJson.append(o.getString("projectName"));
                            projectExperienceJson.append(",");
                            projectExperienceJson.append(o.getString("projectDescription"));
                            projectExperienceJson.append(";");
                        }
                    }
                }
                m.setProjectExperience(projectExperienceJson.toString());
                String languageAbility = m.getLanguageAbility();
                StringBuffer languageAbilityJson=new StringBuffer();
                if(StringUtils.isNotBlank(languageAbility)){
                    JSONArray array=JSONObject.parseArray(languageAbility);
                    if(null!=array && array.size()>0){
                        for (int i = 0; i < array.size(); i++) {
                            JSONObject o =(JSONObject) array.get(i);
                            languageAbilityJson.append(o.getString("languageName"));
                            languageAbilityJson.append(",");
                            languageAbilityJson.append(o.getString("level"));
                            languageAbilityJson.append(";");
                        }
                    }
                }
                m.setLanguageAbility(languageAbilityJson.toString());
                String specialtyAbility = m.getSpecialtyAbility();
                StringBuffer specialtyAbilityJson=new StringBuffer();
                if(StringUtils.isNotBlank(specialtyAbility)){
                    JSONArray array=JSONObject.parseArray(specialtyAbility);
                    if(null!=array && array.size()>0){
                        for (int i = 0; i < array.size(); i++) {
                            JSONObject o =(JSONObject) array.get(i);
                            specialtyAbilityJson.append(o.getString("specialtyName"));
                            specialtyAbilityJson.append(",");
                            specialtyAbilityJson.append(o.getString("level"));
                            specialtyAbilityJson.append(";");
                        }
                    }
                }
                m.setSpecialtyAbility(specialtyAbilityJson.toString());
                String certificates = m.getCertificates();
                StringBuffer certificatesJson=new StringBuffer();
                if(StringUtils.isNotBlank(certificates)){
                    JSONArray array=JSONObject.parseArray(certificates);
                    if(null!=array && array.size()>0){
                        for (int i = 0; i < array.size(); i++) {
                            JSONObject o =(JSONObject) array.get(i);
                            certificatesJson.append(o.getString("time"));
                            certificatesJson.append(",");
                            certificatesJson.append(o.getString("certificatesName"));
                            certificatesJson.append(";");
                        }
                    }
                }
                m.setCertificates(certificatesJson.toString());
                String courses = m.getCourses();
                StringBuffer coursesJson=new StringBuffer();
                if(StringUtils.isNotBlank(courses)){
                    JSONArray array=JSONObject.parseArray(courses);
                    if(null!=array && array.size()>0){
                        for (int i = 0; i < array.size(); i++) {
                            JSONObject o =(JSONObject) array.get(i);
                            coursesJson.append(o.getString("time"));
                            coursesJson.append(",");
                            coursesJson.append(o.getString("coursesName"));
                            coursesJson.append(";");
                        }
                    }
                }
                m.setCourses(coursesJson.toString());
                String practiceExperience = m.getPracticeExperience();
                StringBuffer practiceExperienceJson=new StringBuffer();
                if(StringUtils.isNotBlank(practiceExperience)){
                    JSONArray array=JSONObject.parseArray(practiceExperience);
                    if(null!=array && array.size()>0){
                        for (int i = 0; i < array.size(); i++) {
                            JSONObject o =(JSONObject) array.get(i);
                            practiceExperienceJson.append(o.getString("beginTime"));
                            practiceExperienceJson.append("~");
                            practiceExperienceJson.append(o.getString("endTime"));
                            practiceExperienceJson.append(",");
                            practiceExperienceJson.append(o.getString("practiceName"));
                            practiceExperienceJson.append(",");
                            practiceExperienceJson.append(o.getString("practiceDescription"));
                            practiceExperienceJson.append(";");
                        }
                    }
                }
                m.setPracticeExperience(practiceExperienceJson.toString());
            });
        }
        return datas;
    }

    @Override
    public List<StudentCurriculumVitaeDO> getStudentCurriculumVitaeByStudentId(Long studentId) {

        List<StudentCurriculumVitaeDO> studentCurriculumVitaeDOs=studentCurriculumVitaeMapper.selectList("student_id",studentId);
        for (StudentCurriculumVitaeDO studentCurriculumVitaeDO:studentCurriculumVitaeDOs) {
            if(studentCurriculumVitaeDO!=null&&studentCurriculumVitaeDO.getId()!=null) {
                List<StudentEducationalExperienceDO> studentEducationalExperienceDOS = studentEducationalExperienceMapper.selectListByStudentId(studentCurriculumVitaeDO.getId());
                studentCurriculumVitaeDO.setEducationalExperience(studentEducationalExperienceDOS);
            }
        }
        //教育经历

        return studentCurriculumVitaeDOs;

    }

    @Override
    public StudentCurriculumVitaeRespDTO getStudentInfoByMobile(Long projectId, String mobile){
        StudentDO studentDO = studentMapper.selectOne("mobile", mobile,"deleted",0);
        if(null==studentDO){
            throw exception(STUDENT_NOT_EXIST);
        }
        if(null==studentDO.getStatus() || 1!=studentDO.getStatus()){
            throw exception(STUDENT_NO_AUTH);
        }
        Long entryStudentCount = praxisEntryInfoMapper.getEntryStudentCount(studentDO.getId(), projectId);
        if(null!=entryStudentCount && entryStudentCount>0L){
            throw exception(STUDENT_ALREAD_ENTRY);
        }
        StudentCurriculumVitaeRespDTO dto=null;
        StudentCurriculumVitaeDO studentCurriculumVitaeDO = studentCurriculumVitaeMapper.selectOne(new QueryWrapperX<StudentCurriculumVitaeDO>()
                .eq("student_id", studentDO.getId()).orderByAsc("create_time").last(" limit 1"));
        if(studentCurriculumVitaeDO!=null && studentCurriculumVitaeDO.getId()!=null) {
            List<StudentEducationalExperienceDO> studentEducationalExperienceDOS = studentEducationalExperienceMapper.selectListByStudentId(studentCurriculumVitaeDO.getId());
            studentCurriculumVitaeDO.setEducationalExperience(studentEducationalExperienceDOS);
            dto=StudentCurriculumVitaeConvert.INSTANCE.convert1(studentCurriculumVitaeDO);
        }
        if(null==dto){
            dto=new StudentCurriculumVitaeRespDTO();
            dto.setStudentName(studentDO.getStudentName());
        }
        dto.setStudentId(studentDO.getId());
        dto.setBirthday(studentDO.getBirthday());
        return dto;
    }

    @Override
    public List<StudentExcel> exportStudent(List<StudentDO> list) {
        List<StudentExcel> datas =new ArrayList<>();
        list.stream().forEach(m->{
            StudentExcel e=new StudentExcel();
            BeanUtils.copyProperties(m,e);
            if(1==m.getStatus()){
                e.setStatusText("已认证");
            }else if(2==m.getStatus()){
                e.setStatusText("认证驳回");
            }else if(3==m.getStatus()){
                e.setStatusText("认证中");
            }else{
                e.setStatusText("未认证");
            }
            StudentCurriculumVitaeExportReqVO exportReqVO1 = new StudentCurriculumVitaeExportReqVO();
            exportReqVO1.setStudentId(m.getId());
            exportReqVO1.setStudentExcelFlag(1);
            exportReqVO1.setPageNo(1);
            exportReqVO1.setPageSize(10);
            List<StudentCurriculumVitaeExcelVO> childList = this.exportStudentCurriculumVitaeExcel(exportReqVO1);
            e.setChildList(childList);
            datas.add(e);
        });
        return datas;
    }

    @Override
    public void saveStudentFile(StudentFileDO request) {
        studentCurriculumVitaeMapper.saveStudentFile(request);
    }

    @Override
    public PageResult<StudentFileVO> getStudentFileList(StudentPageReqVO pageReqVO) {
        // MyBatis Plus 查询
        IPage<StudentFileVO> mpPage = MyBatisUtils.buildPage(pageReqVO);
        // 转换返回
        Map<String, Object> params = new HashMap<>();
        mpPage.setRecords(studentCurriculumVitaeMapper.getStudentFileList(mpPage, params));
        return new PageResult<>(mpPage.getRecords(), mpPage.getTotal());
    }
}
